home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
satellit
/
im2gif
/
header.c
< prev
next >
Wrap
Text File
|
1991-11-24
|
1KB
|
78 lines
/* Display IMnnnn file header.
NK6K
*/
struct HEADER {
long start;
long end;
long image;
long retry;
long set;
char integration;
char gain;
}header;
#include <stdio.h>
#include <dos.h>
#include <fcntl.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
char buff[256];
char s1[256];
main(argc,argv)
int argc;
char *argv[];
{
int fi1,fi2,fo;
int i;
if (argc<2) {
printf ("usage: header <im_file> \n");
exit(1);
}
if ((fi1= open(argv[1], O_BINARY)) == -1){
printf("cannot open: %s\n",argv[1]);
perror("On input file");
exit(1);
}
if (read(fi1, &header, sizeof(header))==-1) {
perror("On input file header\n");
exit(1);
}
sprintf(s1, "%s", asctime(gmtime(&header.start))+4);
s1[strlen(s1)-5] = '\0';
printf("sequence start: %15.15s \n", s1);
sprintf(s1, "%s", asctime(gmtime(&header.end))+4);
s1[strlen(s1)-5] = '\0';
printf("image start : %15.15s \n", s1);
printf("Image number : %lu\n",header.image);
printf("Retries : %lu\n",header.retry);
printf("Integration : %u\n",header.integration);
printf("Gain : %u\n",header.gain);
close (fi1);
}